#include "cf_includes.h"

CCF_Sound::CCF_Sound(void)
{
}

CCF_Sound::~CCF_Sound(void)
{
	 FMUSIC_FreeSong (Music);
	 FSOUND_Sample_Free (Sound);
	 FSOUND_Close();

}

void CCF_Sound::Initialize( LPDIRECTSOUND8 directSound, LPSTR filename )
{
}
void CCF_Sound::MusicVolume(int volume)
{
FMUSIC_SetMasterVolume (Music, 256);
}
///////////////////////////////////////////////////////////////////
void CCF_Sound::MusicPaused(bool paused)
{
FMUSIC_SetPaused (Music, paused);
}
///////////////////////////////////////////////////////////////////
void CCF_Sound::MusicLooping(bool loop)
{
FMUSIC_SetLooping (Music, loop);
}
///////////////////////////////////////////////////////////////////
void CCF_Sound::MusicStop()
{
FMUSIC_StopSong (Music);
}
////////////////////////////////////////////////////////////////////
void CCF_Sound::MusicLoad(const char* filen)
{
   FSOUND_Init (44100, 32, 0);
   Music=FMUSIC_LoadSong (filen);
}
void CCF_Sound::MusicPlay()
{
	 FMUSIC_PlaySong (Music);
}

////////////////////////////////////////////////////////////////////
void CCF_Sound::SoundLoad(const char* file)
{
   FSOUND_Init (44100, 32, 0);
   Sound=FSOUND_Sample_Load (FSOUND_FREE,file,FSOUND_LOOP_NORMAL, 0, 0);
 }
void CCF_Sound::SoundPlay()
{
    FSOUND_PlaySound  (0,Sound);
}
void CCF_Sound::SoundVolume(int volume)
{
	FSOUND_SetVolume(FSOUND_ALL ,volume);
}
void CCF_Sound::SoundPaused(bool pause)
{
    FSOUND_SetPaused(FSOUND_ALL,pause);
}
void CCF_Sound::SoundLoop()
{
   FSOUND_SetLoopMode(FSOUND_ALL,FSOUND_LOOP_NORMAL);
}


